{
LANG : PASCAL
PROB : fracdec
}

program FRACDEC;
const
  fi = 'fracdec.in';
  fo = 'fracdec.out';
  max = 100000;
var
  n, d, count, l : longint;
  r : array[0..max] of longint;
  dig : array[1..max] of byte;

procedure getint;
var
  w : longint;
  s : string;
begin
  w := n div d;
  n := n mod d;
  str(w, s);
  count := length(s) + 1;
  write(w, '.');
end;

procedure endl;
begin
  inc(count);
  if count mod 76 = 1 then writeln;
end;

procedure out(s, f : longint);
var
  i : longint;
begin
  for i := s to f do
  begin
    endl;
    write(dig[i]);
  end;
end;

procedure init;
begin
  l := 0;
  fillchar(r, sizeof(r), 0);
end;

procedure getreal;
begin
  while true do
  begin
    inc(l);
    r[n] := l;
    n := n*10;
    dig[l] := n div d;
    n := n mod d;
    if n = 0 then
    begin
      out(1, l);
      break;
    end;
    if r[n] <> 0 then
    begin
      out(1, r[n]-1);
      write('(');
      endl;
      out(r[n], l);
      write(')');
      break;
    end;
  end;
  writeln;
end;

procedure process;
begin
  getint;
  init;
  getreal;
end;

begin
  assign(input, fi); reset(input);
  assign(output, fo); rewrite(output);
  read(n, d);
  process;
  close(output);
  close(input);
end.
